﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using TRPOP.CMS.Message.model;
using System.Reflection;

namespace TRPOP.CMS.Message
{
    public interface IMessage
    {

        /// <summary>
        /// 添加、修改 留言类型
        /// </summary>
        /// <param name="oInfo"></param>
        /// <returns></returns>
        bool SaveMessageType(MessageTypeInfo oInfo);

        /// <summary>
        /// 删除 留言类型
        /// </summary>
        /// <param name="intiMessageTypeID"></param>
        /// <returns></returns>
        bool DeleteMessageType(int intiMessageTypeID);

        /// <summary>
        /// 获取 留言类型列表
        /// </summary>
        /// <param name="intTopn"></param>
        /// <param name="strCondition"></param>
        /// <param name="strOrderby">系统默认提供的排序规则: iDisplayOrder desc</param>
        /// <returns></returns>
        List<MessageTypeInfo> GetMessageTypeInfoList(int intTopn, string strCondition, string strOrderby);


        /// <summary>
        /// 添加、修改 留言状态
        /// </summary>
        /// <param name="oInfo"></param>
        /// <returns></returns>
        bool SaveMessageStatus(MessageStatusInfo oInfo);

        /// <summary>
        /// 删除 留言状态
        /// </summary>
        /// <param name="intiMessageStatusID"></param>
        /// <returns></returns>
        bool DeleteMessageStatus(int intiMessageStatusID);

        /// <summary>
        /// 获取留言状态列表
        /// </summary>
        /// <param name="intTopn"></param>
        /// <param name="strCondition"></param>
        /// <param name="strOrderby">系统默认提供的排序规则: iDisplayOrder desc</param>
        /// <returns></returns>
        List<MessageStatusInfo> GetMessageStatusList(int intTopn, string strCondition, string strOrderby);


        /// <summary>
        /// 新增、修改 留言信息
        /// </summary>
        /// <param name="oInfo"></param>
        /// <returns></returns>
        bool SaveMessage(MessageInfo oInfo);

        /// <summary>
        /// 获取留言信息
        /// </summary>
        /// <param name="intiMessageID"></param>
        /// <returns></returns>
        MessageInfo GetMessageInfo(int intiMessageID);

        /// <summary>
        /// 删除留言信息(软删除)
        /// </summary>
        /// <param name="intiMessageID"></param>
        /// <returns></returns>
        bool DeleteMessageInfo(int intiMessageID);

        /// <summary>
        /// 获取留言信息的分页数据
        /// </summary>
        /// <param name="intPageNumber"></param>
        /// <param name="intPageSize"></param>
        /// <param name="strCondition"></param>
        /// <param name="strOrderby"></param>
        /// <param name="intRecordCount"></param>
        /// <returns></returns>
        List<MessageInfo> GetMessageInfoListByPager(int intPageNumber, int intPageSize, string strCondition, string strOrderby, out int intRecordCount);


        /// <summary>
        /// 新增、编辑 留言回复信息
        /// </summary>
        /// <param name="oInfo"></param>
        /// <returns></returns>
        bool SaveMessageReply(MessageReplyInfo oInfo);

        /// <summary>
        /// 获取 留言回复信息
        /// </summary>
        /// <param name="intiMessageReplyID"></param>
        /// <returns></returns>
        MessageReplyInfo GetMessageReply(int intiMessageReplyID);

        /// <summary>
        /// 删除留言回复信息
        /// </summary>
        /// <param name="intiMessageReplyID"></param>
        /// <returns></returns>
        bool DeleteMessageReply(int intiMessageReplyID);

        /// <summary>
        /// 获取留言回复信息的分页数据
        /// </summary>
        /// <param name="intPageNumber"></param>
        /// <param name="intPageSize"></param>
        /// <param name="strCondition"></param>
        /// <param name="strOrderby"></param>
        /// <param name="intRecordCount"></param>
        /// <returns></returns>
        List<MessageReplyInfo> GetMessageReplyInfoListByPager(int intPageNumber, int intPageSize, string strCondition, string strOrderby, out int intRecordCount);

        /// <summary>
        /// 获取 留言+回复 信息的分页数据
        /// </summary>
        /// <param name="intPageNumber"></param>
        /// <param name="intPageSize"></param>
        /// <param name="strCondition"></param>
        /// <param name="strOrderby"></param>
        /// <param name="intRecordCount"></param>
        /// <returns></returns>
        List<Message_MessageReplyInfo> GetMessage_MessageReplyInfoListByPager(int intPageNumber, int intPageSize, string strCondition, string strOrderby, out int intRecordCount);



    }

    public class MessageAccess
    {
        public static IMessage GetInstance()
        {
            string strPath = "TRPOP.CMS.Message";
            string strClassName = strPath + ".MessageManage";
            return (IMessage)Assembly.Load(strPath).CreateInstance(strClassName);
        }
    }
}
